#!/usr/bin/env tclsh

#按行读取文件方法一
set fp [open file.txt r] 
while {[gets $fp line] != -1 } {
    puts $line
}
close $fp 

puts ""
#按行读取文件方法二
set fp [open file.txt r] 
while {![eof $fp] } {
    gets $fp line
    puts $line
}
close $fp 


